import 'package:flutter/material.dart';
import 'package:xindong/common/xindong_app_info.dart';
import 'package:xindong/common/xindong_sezhi.dart';
import 'package:xindong/manager/network/xindong_networking.dart';
import 'package:xindong/manager/xindong_page_singleton.dart';
import 'package:xindong/res/assets_res.dart';
import 'package:xindong/utils/xindong_image_util.dart';
import 'package:xindong/widgets/common/xindong_app_bar.dart';
import 'package:xindong/widgets/xindong_common_select_item.dart';

class XinDongAboutYeMian extends StatefulWidget {
  const XinDongAboutYeMian({Key? key}) : super(key: key);

  @override
  State<XinDongAboutYeMian> createState() => _XinDongAboutYeMianState();
}

class _XinDongAboutYeMianState extends State<XinDongAboutYeMian> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: XinDongAppBar("关于"),
      body: Column(
        children: [
          Container(
            height: 200,
            alignment: Alignment.center,
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              crossAxisAlignment: CrossAxisAlignment.center,
              children: [
                Container(
                  width: 60,
                  height: 60,
                  clipBehavior: Clip.antiAlias,
                  decoration: BoxDecoration(borderRadius: BorderRadius.circular(10)),
                  child: ImageUtil.asset(AssetsRes.LOGO),
                ),
                const SizedBox(height: 10),
                Text(
                  XinDongAppDeviceInfo.instance.showAppName,
                  style: const TextStyle(fontSize: 15, color: DZColors.titleColor),
                ),
              ],
            ),
          ),
          XinDongCommonSelectItem(
            title: "平台使用规范",
            value: "",
            onTap: () {
              XinDongPageSingleton.instance.jumpToWebYeMian(title: "平台使用规范", url: XinDongNetworking.instance.appUrl);
            },
          ),
          XinDongCommonSelectItem(
            title: "用户使用协议",
            value: "",
            onTap: () {
              XinDongPageSingleton.instance.jumpToWebYeMian(title: "用户协议", url: XinDongNetworking.instance.agreementUrl);
            },
          ),
          XinDongCommonSelectItem(
            title: "用户隐私政策",
            value: "",
            onTap: () {
              XinDongPageSingleton.instance.jumpToWebYeMian(title: "隐私政策", url: XinDongNetworking.instance.privacyUrl);
            },
          ),
          XinDongCommonSelectItem(
            title: "当前版本",
            // title: "软件升级",
            value: XinDongAppDeviceInfo.instance.showAppVersion,
            onTap: null,
            // onTap: () {
            //   // XinDongJumpManager.instance.jumpToWebYeMian(title: "隐私政策", url: XinDongNetworking.instance.privacyUrl);
            // },
          ),
        ],
      ),
    );
  }
}
